package com.zhl.spark.core.simple.complex

import java.io.ObjectInputStream
import java.net.ServerSocket

/**
 * @program: demos
 * @description: ${description}
 * @author: 刘振华
 * @create: 2020-11-30 17:33
 **/
object PlexExecutor2 {

    def main(args: Array[String]): Unit = {
        val socket = new ServerSocket(19992)

        val ac = socket.accept()

        val in = ac.getInputStream()

        val objIn = new ObjectInputStream(in)

        val task = objIn.readObject().asInstanceOf[PlexTask]

        println("[19992]结果为:")
        task.compute().map(println)

        objIn.close()


        socket.close()
    }
}
